﻿package com.javaPattern.DynamicProxy;

public class Client {
	public static void main(String[] args) {
		PassengerProxy1 proxy1 = new PassengerProxy1();
		PassengerProxy2 proxy2 = new PassengerProxy2();
		Passenger realPassenger = new RealPassenger();
		
		Passenger passenger = (Passenger) proxy1.setObj(proxy2
				.setObj(realPassenger));
		passenger.buyTicket();
	}
}